<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use app\controller\ExamsController;
use app\controller\ScoresController;
use app\controller\StudentController;
use app\controller\UserController;
use think\facade\Route;

// 对路由进行分组
Route::group('/api', function () {
// 注册路由
    Route::post('/auth/register', [UserController::class,'register']);
// 登录
    Route::post('/auth/login', [UserController::class,'login']);
    // 注销
    Route::post('/auth/logout', [UserController::class,'logout']);

    // 学生的资源路由
    Route::resource('/students', StudentController::class)->middleware("check");
    Route::resource('/exams', ExamsController::class)->middleware("check");
    Route::resource('/scores', ScoresController::class)->middleware("check");
    
});
